package com.example.controller;

import com.example.pojo.Resource;
import com.example.pojo.Result;
import com.example.service.ResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/resource")
public class ResourceController {
    @Autowired
    private ResourceService resourceService;

    @GetMapping("/she")
    public Result getAll(){
        List<Resource> resources=resourceService.getAll();
        return Result.success(resources);
    }

    @GetMapping("/emp")
    public Result getAlls(){
        List<Resource> resources=resourceService.getAlls();
        return Result.success(resources);
    }

    @GetMapping("/xian")
    public Result getAllss(){
        List<Resource> resources=resourceService.getAllss();
        return Result.success(resources);
    }
}
